package cn.yunhe.java.utils;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class DateUtils {

    static String dateFormat = "yyyy-MM-dd HH:mm:ss";
    static String dateFormat2 = "yyyyMMddHHmmss";

    /**
     * 获取服务器系统时间
     * @return
     */
    public static String getSystemDate(){
        return LocalDateTime.now().format(DateTimeFormatter.ofPattern(dateFormat));
    }

    public static String getDateString(){
        return LocalDateTime.now().format(DateTimeFormatter.ofPattern(dateFormat2));
    }
}
